<template>
  <article-detail :is-edit="true" />
</template>

<script>
import ArticleDetail from './components/ArticleDetail'

export default {
  name: 'EditArticle',
  components: { ArticleDetail },
  beforeRouteLeave(to, from, next) {
    // 如果返回到列表页面则缓存列表页，否则不缓存
    if (to.path.indexOf('/content/list') > -1) {
      this.$store.commit('permission/SET_INCLUDELIST', ['ContentList'])
    } else {
      this.$store.commit('permission/SET_INCLUDELIST', [])
    }
    next()
  }
}
</script>
